package com.sinodata.bsm.common.vo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * ResFindDef entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "RES_FIND_DEF")
public class ResFindDef implements java.io.Serializable, Comparable {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 8378775537595379226L;

    // Fields    
    private Long id;
    private Long parentTypeId;
    private Long resTypeId;
    private String collector;

    // Constructors

    /** default constructor */
    public ResFindDef() {
    }

    /** minimal constructor */
    public ResFindDef(Long id) {
        this.id = id;
    }

    /** full constructor */
    public ResFindDef(Long id, Long parentTypeId, Long resTypeId, String collector) {
        this.id = id;
        this.parentTypeId = parentTypeId;
        this.resTypeId = resTypeId;
        this.collector = collector;
    }

    // Property accessors
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequence")
    @SequenceGenerator(name = "sequence", sequenceName = "RES_FIND_DEF_SEQ")
    @Column(name = "ID", unique = true, nullable = false, precision = 18, scale = 0)
    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "PARENT_TYPE_ID", precision = 18, scale = 0)
    public Long getParentTypeId() {
        return this.parentTypeId;
    }

    public void setParentTypeId(Long parentTypeId) {
        this.parentTypeId = parentTypeId;
    }

    @Column(name = "RES_TYPE_ID", precision = 18, scale = 0)
    public Long getResTypeId() {
        return this.resTypeId;
    }

    public void setResTypeId(Long resTypeId) {
        this.resTypeId = resTypeId;
    }

    @Column(name = "COLLECTOR", length = 2048)
    public String getCollector() {
        return this.collector;
    }

    public void setCollector(String collector) {
        this.collector = collector;
    }

    @Override
    public String toString() {
        return "ResFindDef [id=" + id + ", parentTypeId=" + parentTypeId + ", resTypeId=" + resTypeId + ", collector=" + collector + "]";
    }

    @Override
    public int compareTo(Object o) {
        int result = 0;
        if (o instanceof ResFindDef) {
            ResFindDef anotherResFindDef = (ResFindDef) o;
            long l = this.id - anotherResFindDef.id;
            if (l > 0) {
                result = 1;
            } else if (l < 0) {
                result = -1;
            }
        }
        return result;
    }

}